﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MiniScrum.Models;

namespace MiniScrum.Controllers
{
    public class RoleController : Controller
    {
        //
        // GET: /Role/

        public ActionResult UserRoles(int id)
        {
            return View(Role.GetUserRoles(id));
        }

        [HttpPost]
        public ActionResult UserRoles(UserRolesModel model)
        {
            try
            {
                Role.SaveUserRoles(model);
                return RedirectToAction("Details", "User", new { id = model.UserId });
            }
            catch
            {
                return View(model);
            }
        }



    }
}
